package idea;

/**
 * Created with IntelliJ IDEA.
 * ClassName: Debug
 * Package: idea
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-12-24
 * Time: 20:40
 */

public class Debug02 {
    //方法断点
    public static void main(String[] args) {

        //1.
//        Son instance = new Son();
//        instance.test();

        //多态 会跳转到子类的方法 当中 但是 在父类的方法打断点 也会停下来 停在子类的方法上
        Father instance1 = new Son();
        instance1.test();
        //接口的实现类 也是如此
        Consumer con = new ConsumerImpl();
        con.accept("atguigu");


    }
}

class Father {
    public void test() {
        System.out.println("Father : test1");
        System.out.println("Father : test2");
    }
}

class Son extends Father {
    @Override
    public void test() { //方法断点  点在方法上  菱形
        System.out.println("Son : test1");
        System.out.println("Son : test2");
    }
}

interface Consumer {
    void accept(String str);
}

class ConsumerImpl implements Consumer {
    @Override
    public void accept(String str) {
        System.out.println("ConsumerImple: " + str);
    }
}